using System;

namespace FrameworkBase
{
    public class Event<T> where T : Event<T>
    {
        private static Action _onEvent;
        
        public static void Register(Action onEvent)
        {
            _onEvent += onEvent;
        }

        public static void UnRegister(Action onEvent)
        {
            _onEvent -= onEvent;
        }

        /// <summary>
        /// 事件触发器
        /// </summary>
        public static void Trigger()
        {
            _onEvent?.Invoke();
        }
    }
}